package singleton

import (
	"math/rand"
	"sync"
)

type singleton struct {
	num int
}

var (
	instance *singleton
	once     sync.Once
	//lock     sync.Mutex
)

func GetInstance() *singleton {
	once.Do(func() {
		instance = &singleton{
			num: rand.Int(),
		}
	})
	return instance
}
